<template>
	<view class="detail">
		<view class="title-wrapper">
			<view class="title">
				{{ info.noticeTitle }}
			</view>
			<view class="info-wrapper">
				<view class="author">
					{{ info.createBy }}
				</view>
				<view class="date">
					{{ info.createTime }}
				</view>
			</view>
		</view>
		<view class="content-wrapper">
			<rich-text :nodes="info.noticeContent">
			</rich-text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: {}
			}
		},
		onLoad(option) {
			this.getInfo(option.id)
		},
		methods: {
			async getInfo(id) {
				const data = await this.$api.get('/adm/notice/getInfo', {
					noticeId: id
				})
				if (data.code === 200) {
					this.info = data.data;
				}
			}
		},
		components: {

		}
	}
</script>

<style lang="scss" scoped>
	.detail {
		height: 100%;
		overflow: auto;
		background-color: #fff;
		padding-bottom: 50upx;

		.title-wrapper {
			background-color: #fff;
			padding: 30upx 30upx;
			border-top: 5rpx solid #F2F4FA;
			border-bottom: 5rpx solid #F2F4FA;

			.title {
				font-size: 32upx;
				font-weight: bold;
				width: 100%;
				text-align: center;
			}

			.info-wrapper {
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 28upx;
				color: #666666;
				margin-top: 30upx;

				.author {
					margin-right: 40upx;
				}
			}
		}

		.content-wrapper {
			font-size: 32upx;
			background-color: #ffffff;
			padding: 30upx;
			line-height: 50upx;
		}
	}
</style>